# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=IO-Socket-INET6
pkgname="perl-${_realname}"
pkgver=2.72
pkgrel=4
pkgdesc="Object interface for AF_INET|AF_INET6 domain sockets"
arch=('any')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl-Socket6>=0.12')
makedepends=()
url='http://search.cpan.org/dist/IO-Socket-INET6'
groups=('perl-modules')
source=("http://search.cpan.org/CPAN/authors/id/S/SH/SHLOMIF/${_realname}-${pkgver}.tar.gz")
md5sums=('510ddc1bd75a8340ca7226123fb545c1')

build() {
  ( export PERL_MM_USE_DEFAULT=1 PERL5LIB=""                 \
      PERL_AUTOINSTALL=--skipdeps                            \
      PERL_MM_OPT="INSTALLDIRS=vendor"     \
      PERL_MB_OPT="--installdirs vendor" \
      MODULEBUILDRC=/dev/null

    cd "${_realname}-${pkgver}"
    /usr/bin/perl Makefile.PL
    make
  )
}

check() {
  cd "${_realname}-${pkgver}"
  ( export PERL_MM_USE_DEFAULT=1 PERL5LIB=""
    make test
  )
}

package() {
  cd "${_realname}-${pkgver}"
  make DESTDIR="$pkgdir" install
  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}
